//
// Created by longPc on 2024/5/4.
//

#ifndef BASIC_OPENGLWIDGET9_H
#define BASIC_OPENGLWIDGET9_H


#include <QOpenGLWidget>
#include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLShaderProgram>
#include <QTimer>

/// 更多属性：把颜色数据加进顶点数据中
class OpenGLWidget9 : public QOpenGLWidget, QOpenGLFunctions_3_3_Core {
Q_OBJECT
public:
    enum Shape {
        None, Rect, Circle, Triangle
    };

    explicit OpenGLWidget9(QWidget *parent = nullptr);

    ~OpenGLWidget9() override;

    /// 绘制图形
    void drawShape(Shape shape);

    void wrieframeMode(bool mode);

protected:
    void initializeGL() override; ///< QOpenGLWidget的需要实现的函数
    void resizeGL(int w, int h) override; ///< QOpenGLWidget的需要实现的函数
    void paintGL() override; ///< QOpenGLWidget的需要实现的函数


public slots:

private:
    Shape m_shape;
    /// 链接着色器的对象
    QOpenGLShaderProgram m_shaderProgram;
    /// 定时器
    QTimer m_timer;
};;


#endif //BASIC_OPENGLWIDGET9_H
